﻿//------------------------------------------------------------
// AureFramework
// Developed By YYYurz.
// GitHub: https://github.com/YYYurz
// Gitee: https://gitee.com/yyyurz
// Email: 1228396352@qq.com
//------------------------------------------------------------

using AureFramework.Event;
using AureFramework.ReferencePool;

namespace AureFramework.Network
{
	public class NetworkCloseEventArgs : AureEventArgs
	{
		public INetworkChannel NetworkChannel
		{
			get;
			private set;
		}
		
		public static NetworkCloseEventArgs Create(INetworkChannel networkChannel)
		{
			var networkCloseEventArgs = Aure.GetModule<IReferencePoolModule>().Acquire<NetworkCloseEventArgs>();
			networkCloseEventArgs.NetworkChannel = networkChannel;

			return networkCloseEventArgs;
		}
		
		public override void Clear()
		{
			NetworkChannel = null;
		}
	}
}